﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Global.Master" AutoEventWireup="true" CodeBehind="CDCShowTable.aspx.cs" Inherits="WebAsbesto.CDC.CDC" %>


<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table class="auto-style2" align="center">
        <tr>
            <td colspan="2">
                <asp:Label ID="lbl_Titulo" runat="server" Text="Cadenas de custodia" Style="text-align: center" Font-Size="25" ForeColor="Green"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="auto-style3">
                <asp:Label ID="lbl_Obra" runat="server" Text="Obra: "></asp:Label>
            </td>
            <td class="auto-style3">
                <asp:DropDownList ID="ddl_Obras" runat="server" DataSourceID="OdObras" DataTextField="Nombre" DataValueField="Id_Obra">
                </asp:DropDownList>
                <asp:SqlDataSource ID="OdObras" runat="server" ConnectionString="<%$ ConnectionStrings:AsbestoConnectionString %>" SelectCommand="SELECT Id_Obra, Nombre FROM Obras"></asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Button ID="btn_Buscar" runat="server" Text="Buscar" OnClick="btn_Buscar_Click" />
                <asp:Button ID="btn_Ingresar_Nueva_CDC" runat="server" Text="Nueva" OnClick="btn_Ingresar_Nuevo_Cliente_Click" />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                &nbsp;</td>
        </tr>
    </table>
    <div align="Center">
    <asp:GridView ID="Grd_Datos_CDC" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataSourceID="SqlDataSource1" ForeColor="Black" GridLines="Horizontal" AllowSorting="True" DataKeyNames="Id_CDC,Id_Obra" AllowPaging="True">
        <Columns>
            <asp:BoundField DataField="Id_CDC" HeaderText="Id_CDC" InsertVisible="False" ReadOnly="True" SortExpression="Id_CDC" />
            <asp:BoundField DataField="Nombre" HeaderText="Obra" SortExpression="Nombre" />
            <asp:BoundField DataField="Id_Obra" HeaderText="Id_Obra" SortExpression="Id_Obra" ReadOnly="True" Visible="False" />
            <asp:BoundField DataField="Fecha_Envio" HeaderText="Fecha_Envio" SortExpression="Fecha_Envio" />
            <asp:BoundField DataField="Nota" HeaderText="Nota" SortExpression="Nota" />
            <asp:CommandField ButtonType="Image" CancelImageUrl="~/Images/cancelar.png" EditImageUrl="~/Images/editar.png" ShowEditButton="True" UpdateImageUrl="~/Images/Aceptar.png" />
        </Columns>
        <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
        <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
        <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F7F7F7" />
        <SortedAscendingHeaderStyle BackColor="#4B4B4B" />
        <SortedDescendingCellStyle BackColor="#E5E5E5" />
        <SortedDescendingHeaderStyle BackColor="#242121" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AsbestoConnectionString %>" DeleteCommand="CDC_B" DeleteCommandType="StoredProcedure" InsertCommand="CDC_A" InsertCommandType="StoredProcedure" SelectCommand="CDC_L" SelectCommandType="StoredProcedure" UpdateCommand="CDC_M" UpdateCommandType="StoredProcedure">
        <DeleteParameters>
            <asp:Parameter Name="Id_CDC" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Id_Obra" Type="Int32" />
            <asp:Parameter Name="Fecha_Envio" Type="DateTime" />
            <asp:Parameter Name="Nota" Type="String" />
        </InsertParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="ddl_Obras" Name="id_Obra" PropertyName="SelectedValue" Type="Int32" DefaultValue="-1" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="Id_CDC" Type="Int32" />
            <asp:Parameter Name="Nombre" Type="String" />
            <asp:Parameter Name="Id_Obra" Type="Int32" />
            <asp:Parameter Name="Fecha_Envio" Type="DateTime" />
            <asp:Parameter Name="Nota" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
    </div>
    <br />

</asp:Content>
